package com.qf.demo;

import com.qf.dao.AccountDao;
import com.qf.dao.PersonDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class PersonTest {
    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("bean.xml");
        //获取bean  默认是一个单例的
        //如何把bean变成多例
        PersonDao accountDao = (PersonDao) applicationContext.getBean("personDao");
        accountDao.addPerson();
        //关闭容器
//        ((ClassPathXmlApplicationContext) applicationContext).close();
    }
}
